-
Notifications
You must be signed in to change notification settings - Fork 421
Make REST catalog namespace separator configurable #2826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@geruh thanks so much for your review! I've addressed your comments |
|
i was reviewing this and got distracted, a couple of times 😆 |
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding this feature
Could you add an integration test against the iceberg-rest-fixture? Currently http://localhost:8181/v1/config returns
"overrides": {
"namespace-separator": "%2E"
},
| return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root), kind.value: identifier.name} | ||
| return { | ||
| "namespace": self._encode_namespace_path(tuple(identifier.namespace.root)), | ||
| kind.value: quote(identifier.name, safe=""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why quote is used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the namespace separator has a '/' in it? We need to make sure that it isn't interpreted as part of the path.
Added a comment to make this clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we make this a helper function? i can see a scenario where someone will forget to use quote
Fokko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @rambleraptor
I agree with @kevinjqliu's comments, but apart from that this looks good to me. Thanks for adding this 👍
20cea63 to
dac44f4
Compare
The REST spec currently uses %1F as the UTF-8 encoded namespace separator for multi-part namespaces.
dac44f4 to
2c616fc
Compare
|
@kevinjqliu @Fokko ready to merge! |
| # fallback in order to work with older rest catalog implementations | ||
| if Capability.V1_NAMESPACE_EXISTS not in self._supported_endpoints: | ||
| try: | ||
| self.load_namespace_properties(namespace_tuple) | ||
| return True | ||
| except NoSuchNamespaceError: | ||
| return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intentional? i think we still need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root), kind.value: identifier.name} | ||
| return { | ||
| "namespace": self._encode_namespace_path(tuple(identifier.namespace.root)), | ||
| kind.value: quote(identifier.name, safe=""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we make this a helper function? i can see a scenario where someone will forget to use quote
Closes #1183
This adds a configurable namespace separator in the REST Catalog.
Rationale for this change
Certain implementations expect a different namespace separator.
Are these changes tested?
Tests included.
Are there any user-facing changes?